<?php
$page = Yii::app()->getRequest()->getParam('CompanySetting_page') ? Yii::app()->getRequest()->getParam('CompanySetting_page') : 1;
$this->breadcrumbs=array(
    Yii::t('site','Admin')=>array('/admin'),
    Yii::t('site','Company Settings')=>array('index','CompanySetting_page'=>$page),
    Yii::t('site','Manage'),
);

$this->menu=array(
    array('label'=>Yii::t('site','All Items'), 'items'=>array(
        array('label'=>Yii::t('site','Create New Company Setting'), 'url'=>array('create','CompanySetting_page'=>$page)),
    )),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
    $('.search-form').toggle(400);
    return false;
});
$('.search-form form').submit(function(){
    $('.search-form').toggle();
    $.fn.yiiGridView.update('company-setting-grid', {
        data: $(this).serialize()
    });
    return false;
});
");
?>

<h1><?php echo Yii::t('site','Manage Company Settings'); ?></h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php echo CHtml::link(Yii::t('site','Advanced Search'),'#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
    'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'company-setting-grid',
    'dataProvider'=>$model->search(),
    'filter'=>$model,
    'summaryCssClass' => 'gridViewSummary',
    'template' => "{summary}\n{pager}\n{items}\n{pager}",
    'htmlOptions' => array(),
    'afterAjaxUpdate'=>'fixHeaders',
    'columns'=>array(
        $buttons,
        /*
        array(
            'class'=>'CButtonColumn',
        ),
        */
        'id',
         array(
            'name'=>'userId',
            'type'=>'raw',
            'value'=>'!is_null($data->masterUser) ? $data->masterUser->recordName : \'-\''
        ),
        array(
            'name'=>'isVirgin',
            'type'=>'raw',
            'value'=>'$data->isVirgin==1 ? \'[X]\' : \'-\''
        ),
        'companyName',
        array(
            'name'=>'address',
            'type'=>'raw',
            'value'=>'nl2br(CHtml::encode($data->address))',
        ),
        /*
        'addressLine1',
        'addressLine2',
        'postCode',
        'town',
        'country',
        'companyPhoneNbr',
        'companyFaxNbr',
        'logoFileName',
        'logoFileType',
        'logoFileSize',
        'logoFileContent',
        'taxNbr',
        'vatNbr',
        'bankAccountOwner',
        'bankName',
        'bankNbr',
        'bankAccountNbr',
        'currency',
        'invoiceNbrTemplate',
        'termsOfPayment',
        'receiptNbrTemplate',
        'bankAccountTransactionProfile',
        'accountFrame',
        'hourRate1Description',
        'hourRate1Amount',
        'hourRate2Description',
        'hourRate2Amount',
        'vehicleField1Label',
        'vehicleField2Label',
        'vehicleField3Label',
        'vehicleField4Label',
        'vehicleField5Label',
        'reminderLevel1Note',
        'reminderLevel1Fee',
        'reminderLevel2Note',
        'reminderLevel2Fee',
        'reminderLevel3Note',
        'reminderLevel3Fee',
        */
    ),
)); ?>
